<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>获取你的位置</div>


    <!-- <script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script> -->
    <!-- <script src="http://api.map.baidu.com/api?ak=你的AK码&v=2.0&services=false"></script> -->
    <script>
        // navigator.geolocation.getCurrentPosition(function (position) {
        //     var lat = position.coords.latitude;
        //     var lon = position.coords.longitude;
        //     var point = new BMap.Point(lon, lat);  
        //     //  // 创建坐标点 
        //     //   // 根据坐标得到地址描述
        //     var myGeo = new BMap.Geocoder();
        //     myGeo.getLocation(point, function (result) {
        //         var city = result.addressComponents.city;
        //         $('body').html(city);
        //         alert(city);
        //     });
        // });

        var location_lon = '',location_lat = ''; // 经度,纬度
        if (navigator.geolocation){
            
            navigator.geolocation.getCurrentPosition(function (position) {
                console.log("你拿包");
                location_lon = position.coords.longitude;
                location_lat = position.coords.latitude;
            // alert('h5经度：'+location_lon);alert('h5纬度：'+location_lat);
                alert('h5经度：'+location_lon);
            });
        }else {
            alert("您的设备不支持定位功能");
        }
    </script>

   

    <!-- <script>
        var city = remote_ip_info['city'];
        alert(city)
    </script> -->
    
</body>
</html>